/* 
 * File:   Graph.h
 * Author: reinhard
 *
 * Created on 30. September 2011, 11:26
 */

#ifndef GRAPH_H
#define	GRAPH_H
#include <set>
#include <vector>
#include <iostream>
#include <fstream>
#include <vector>
#include <utility>
class Node;
class Edge;
class Polynomial;
class Graph {
public:
    Graph();
    Graph(std::string fileName);
    Graph(std::vector<Node*>* nodes, std::vector<Edge*>* edges);
    Graph(const Graph& orig);
    virtual ~Graph();
    int numOfEdges();
    int size();
    Polynomial getPoly();
private:
    int numNodes;
    int numEdges;
    std::vector<Node*>* nodes;
    std::vector<Edge*>* edges;
    Graph* shrinkGraph();
};

class Edge {
public:
    Edge(Node*,Node*);
    Edge(const Edge& orig);
    virtual ~Edge();
    Node* getFromNode();
    Node* getToNode();
    bool isLoop();
private:
    std::pair<Node*,Node*>* nodes;

};

class Node {
public:
    Node();
    Node(int id);
    Node(const Node& orig);
    virtual ~Node();
    void addInEdge(Edge* edge);
    void addOutEdge(Edge* edge);
private:
    int id;
    std::vector<Edge*>* outEdges;
    std::vector<Edge*>* inEdges;
};
#endif	/* GRAPH_H */

